<div class="adminnavi">
  <a href="./index.php"><{$smarty.const._MI_MILEAGE_LANG_MILEAGE}></a>
  &raquo;&raquo; <{$smarty.const._MI_MILEAGE_ADMENU_CHARGE}>
</div>

<{if $actionForm->hasError()}>
  <ul class="error">
    <{foreach item=message from=$actionForm->getErrorMessages()}>
      <li><{$message|xoops_escape}></li>
    <{/foreach}>
  </ul>
<{/if}>

<form action="index.php?action=Charge" method="post">
  <table class="outer" summary="">
    <tbody>

      <tr>
        <th class="head"><{$smarty.const._MD_MILEAGE_LANG_UID}></th>
        <td class="<{cycle values="odd,even"}>">
          <input type="text" name="toUid" onBlur="mileage_get_uname()" id="mileage_toUid" />
          <a href="#" onClick="mileage_get_uname();return false;"><{$smarty.const._AD_MILEAGE_LANG_CONFIRM}></a>
          <div id="mileage_uname"></div>
        </td>
      </tr>

      <tr>
        <th class="head"><{$smarty.const._MD_MILEAGE_LANG_POINT}></th>
        <td class="<{cycle values="odd,even"}>">
          <{xoops_input type=text name=point value=""}>
        </td>
      </tr>

    </tbody>
    <tfoot>
      <tr>
        <td class="foot" colspan="2">
          <{xoops_token form=$actionForm}>
          <{xoops_input type=hidden name=mile_id value="0"}>
          <{xoops_input type=hidden name=uid value=""}>
          <{xoops_input type=hidden name=reg_unixtime value=""}>
          <{xoops_input type=hidden name=name value="charged"}>
          <{xoops_input type=hidden name=url value="charge"}>
          <{xoops_input type=hidden name=suburl value="0"}>
          <{xoops_input type=hidden name=interval value="0"}>
          <{* xoops_input type=hidden name=group[] value="" *}>
          <input type="submit" value="<{$smarty.const._SUBMIT}>" />
          <input type="submit" value="<{$smarty.const._CANCEL}>" name="_form_control_cancel" />
        </td>
      </tr>
    </tfoot>
  </table>
</form>


<script type="text/javascript" src="http://www.google.com/jsapi"></script>  
<script type="text/javascript">google.load("jquery", "1");</script>
<script type="text/javascript" charset="UTF-8">
<!--
jQuery.noConflict();
var post_flag = false;
function mileage_get_uname()
{
  var uid = jQuery('#mileage_toUid').val();
  uid = parseInt(uid);
  if (post_flag == false) {
    if (uid != '' && uid > 0) {
      post_flag = true;// TODO error / .post method -> .ajax method 
      jQuery.post('<{$smarty.const.XOOPS_URL}>/modules/<{$dirname}>/get.php', {'page':'uname', 'uid':uid}, display_uname);
    } else {
      alert('** Wrong Request **');
    }
  } else {
    alert('** Wating.. **');
  }
}
function display_uname(uname)
{
  if (uname == '') uname = 'NO USER';
  if (uname.length > <{$maxuname}>) {
    uname = uname.slice(0, <{$maxuname}>) + '...';
  }
  jQuery('#mileage_uname').text(uname);
  post_flag = false;
}
// -->
</script>
